home *** CD-ROM | disk | FTP | other *** search
/ CyberMycha 2008 January / Cybermycha 1_2008.iso / dema / crysis_sp_demo.exe / Levels1.cab / _90D088B51FA24DC0904FDEF7AB703C1E < prev    next >
Encoding:
Text File  |  2007-10-15  |  888 b   |  50 lines

  1. Mission = {
  2. };
  3.  
  4.  
  5. function Mission:OnInit()
  6.     -- you may want to load a string-table etc. here...
  7. end
  8.  
  9. function Mission:OnUpdate()
  10.     local i;
  11.     local bFinished=1;
  12.     for i,objective in Mission do
  13.         if (type(objective)~="function") then
  14.             if (objective==0) then 
  15.                 bFinished=0;                
  16.             else
  17.             end
  18.         end    
  19.     end
  20.     if (bFinished==1) then    
  21.         self.Finish();
  22.     end
  23. end
  24.  
  25.  
  26. function Mission:Finish()
  27.     -- go to next mission...
  28. end
  29.  
  30. function Mission:AttachObject(entName, objName, attName)
  31.  
  32.             local ent = System.GetEntityByName(entName);
  33.  
  34.             local obj = System.GetEntityByName(objName);
  35.  
  36.             if (ent) then
  37.  
  38.               if (obj) then
  39.  
  40.                         ent:SetAttachmentObject( 0, attName, obj.id, -1, 0 );
  41.  
  42.             else
  43.  
  44.                         ent:ResetAttachment( 0, attName );
  45.  
  46.             end
  47.  
  48.             end
  49.  
  50. end